/**
 * 
 */
package com.lvmama.vst.activemq.consumer;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

/**
 * @author fengyonggang
 *
 */
@Component
public class MessageListener {

	private static final Logger LOGGER = LoggerFactory.getLogger(MessageListener.class);
	private static final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	@JmsListener(destination = "foo")
	public void process(String message) {
		LOGGER.info("Received a message");
		System.out.println(format.format(new Date()) + ":" + message);
	}
}
